		**********************************************************
		** File: cleaning_Neumayer_2006.do						**
		** Paper: Human Trafficking Indicators: A New Dataset	**
		** Author: Richard Frank								**
		** Date: July 11, 2021									**
		** Task: Cleaning Neumayer (2006) replication data		**
 		**********************************************************

		clear all
		version 16.1
		set seed 1234 
		
		cd "~"
	 
		** Data source: https://www.lse.ac.uk/geography-and-environment/eric-neumayer 
		
		*	Visa restriction: 1 = home country imposes visa on target country;
		* 0 = home country does not impose visa restriction on target country. Source: IATA (2004).

 
		use "Article-for-Transactions.dta"
		collapse (sum) visa , by(homecountry)
		save visa_dest.dta, replace
		rename homecountry country
		sort visa
		rename visa visa_dest
		save visa_source.dta, replace
		
		use "Article-for-Transactions.dta", clear
		collapse (sum) visa , by(targetedc)
		rename targ country
		sort visa
		rename visa visa_source
		merge 1:1 country using visa_source.dta
		drop _merge
		label var visa_dest "This country imposes visas on # other countries (Neumayer 2006)"
		label var visa_source "# other countries imposing visas on this country (Neumayer 2006)"
		rename country Country
		run "cow.do"
		sort ccode
		tab Country if ccode==0
		drop if ccode==0
		order Country ccode
		rename Country country			
		sort ccode
		drop if country=="Hong Kong, China"
				
		save "Neumayer_visas.dta", replace		
				
